package priv.mill.server.impl;
import java.util.List;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import priv.mill.dao.mapper.<%=xia2Pasic(tableName)%>Mapper;
import priv.mill.entry.<%=xia2Pasic(tableName)%>;
import priv.mill.server.<%=xia2Pasic(tableName)%>Service;

@Component
public class <%=xia2Pasic(tableName)%>ServiceImpl implements <%=xia2Pasic(tableName)%>Service{

	private static final Logger logger = Logger
			.getLogger(<%=xia2Pasic(tableName)%>ServiceImpl.class);

	@Autowired
	private <%=xia2Pasic(tableName)%>Mapper <%=xia2TuoFeng(tableName)%>Mapper;
	
	@Override
	public <%=xia2Pasic(tableName)%> get<%=xia2Pasic(tableName)%>ById(Integer <%=xia2TuoFeng(tableName)%>Id) {
		return <%=xia2TuoFeng(tableName)%>Mapper.get<%=xia2Pasic(tableName)%>ById(<%=xia2TuoFeng(tableName)%>Id);
	}

	@Override
	public <%=xia2Pasic(tableName)%> get<%=xia2Pasic(tableName)%>ByEntry(<%=xia2Pasic(tableName)%> <%=xia2TuoFeng(tableName)%>) {
		return <%=xia2TuoFeng(tableName)%>Mapper.get<%=xia2Pasic(tableName)%>ByEntry(<%=xia2TuoFeng(tableName)%>);
	}

	@Override
	public List<<%=xia2Pasic(tableName)%>> get<%=xia2Pasic(tableName)%>sByPage(<%=xia2Pasic(tableName)%> <%=xia2TuoFeng(tableName)%>) {
		return <%=xia2TuoFeng(tableName)%>Mapper.get<%=xia2Pasic(tableName)%>sByPage(<%=xia2TuoFeng(tableName)%>);
	}

	@Override
	public int update<%=xia2Pasic(tableName)%>(<%=xia2Pasic(tableName)%> <%=xia2TuoFeng(tableName)%>) {
		return <%=xia2TuoFeng(tableName)%>Mapper.update<%=xia2Pasic(tableName)%>(<%=xia2TuoFeng(tableName)%>);
	}

	@Override
	public int insert<%=xia2Pasic(tableName)%>(<%=xia2Pasic(tableName)%> <%=xia2TuoFeng(tableName)%>) {
		return <%=xia2TuoFeng(tableName)%>Mapper.insert<%=xia2Pasic(tableName)%>(<%=xia2TuoFeng(tableName)%>);
	}

	@Override
	public int delete<%=xia2Pasic(tableName)%>(Integer <%=xia2TuoFeng(tableName)%>Id) {
		return <%=xia2TuoFeng(tableName)%>Mapper.delete<%=xia2Pasic(tableName)%>(<%=xia2TuoFeng(tableName)%>Id);
	}
}
